 

function announcementDetailCtrl($scope, $http) {
  'ngInject';

  let id = $state.params.id;

  this.noticeDetail = {};

  this.getNoticeDetail = () => {
  	$http.get(`${SERVER_CONTEXT}/api/user/app/notice/queryNoticeDetails/${id}`)
  	  .then((resp) => {
  	    this.noticeDetail = resp.data;
  	  });
  }

  // 文件下载
  this.getDownloadSrc = (file) => {
    return `${SERVER_CONTEXT}/api/user/app/notice/downloadNoticeInfo/${file.id}`;
  }

  // 文件预览
  this.preview = (archiveDetail) => {
    let url = $state.href('documentPreview', {
      id: archiveDetail.id,
    });
    window.open(url,'_blank');
  }


  this.initPage = () => {
  	// 公告详情接口
  	this.getNoticeDetail();
  }

  this.initPage();

}

export default announcementDetailCtrl;